home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1997 July / Software of the Month Club - Business (Volume 239) (July 1997).iso / pc / code / shared.dxr / 04483_Kam's scroll Code.ls < prev    next >
Encoding:
Text File  |  1996-02-21  |  1.9 KB  |  69 lines

  1. global gOBJECTS, gStates, gdirty
  2.  
  3. on pickListDown ObjRef
  4.   unselectList()
  5.   set obj to getaProp(gOBJECTS, ObjRef)
  6.   set theClickOn to getaProp(obj, #spriteNum)
  7.   set thisLine to the mouseLine
  8.   set thisListField to getaProp(getaProp(obj, #cast), #text)
  9.   set howMany to the number of lines in field thisListField
  10.   if thisLine = -1 then
  11.     return 0
  12.   else
  13.     if thisLine > howMany then
  14.       if line thisLine of field thisListField = EMPTY then
  15.         return 0
  16.       end if
  17.     end if
  18.   end if
  19.   set the foreColor of line thisLine of field thisListField to getIndex([8: 7, 16: 16912, 32: 8421504])
  20.   repeat while the stillDown
  21.     if (the mouseLine = -1) or not rollOver(theClickOn) then
  22.       set thisLine to the mouseLine
  23.       unselectList(thisListField)
  24.       next repeat
  25.     end if
  26.     if the mouseLine <> thisLine then
  27.       if the mouseLine <> -1 then
  28.         set thisLine to the mouseLine
  29.       end if
  30.       unselectList(thisListField)
  31.       set the foreColor of line thisLine of field thisListField to getIndex([8: 7, 16: 16912, 32: 8421504])
  32.     end if
  33.   end repeat
  34.   if (thisLine <> -1) and rollOver(theClickOn) then
  35.     objectPickListAction(ObjRef, thisLine, howMany)
  36.   else
  37.     return 0
  38.   end if
  39. end
  40.  
  41. on unselectList
  42.   set the foreColor of field getaProp(getaProp(getaProp(gOBJECTS, #pickListText), #cast), #text) to getIndex([8: 255, 16: 0, 32: 0])
  43. end
  44.  
  45. on objectPickListAction ObjRef, thisLine, howMany
  46.   set listCount to howMany - 1
  47.   if thisLine = 0 then
  48.     exit
  49.   end if
  50.   if thisLine = -1 then
  51.     exit
  52.   end if
  53.   if thisLine > listCount then
  54.     exit
  55.   end if
  56.   putObject(ObjRef, thisLine)
  57. end
  58.  
  59. on putObject ObjRef, thisLine
  60.   put line thisLine of field getaProp(getaProp(getaProp(gOBJECTS, ObjRef), #cast), #text) into field getaProp(getaProp(getaProp(gOBJECTS, #SaveNameText), #cast), #text)
  61.   set gdirty to 1
  62. end
  63.  
  64. on slider ObjRef
  65. end
  66.  
  67. on setScroll ObjRef, sliderLoc
  68. end
  69.